package com.gzy.xuexiziliao.mapper;

import com.gzy.xuexiziliao.pojo.entity.Information;
import org.apache.ibatis.annotations.*;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface InformationMapper {


    void save(Information information);



    void update(Information information);

    void deleteByIds(List<Integer> ids);

    List<Information> list(String name, Short gender, LocalDate begin, LocalDate end);

    @Select("select * from information where title like concat('%',#{title},'%')")
    Information getBYTitle(Information information);

    @Select("select * from information where category_id = #{categoryId}")
    List<Information> getBycategoryId(int categoryId);
    @Update("update information set category_id = #{categoryId} where information_id = #{informationId}")
    void updateCategoryName(int informationId, String categoryName);


    @Select("select * from information where category_id = #{categoryid}")
    List<Information> getcategoryId(Integer categoryid);

    @Select("select * from information where information_id = #{informationId}")
    Information getBYInformationId(int informationId);
}
